from src.handler.event import Event
from src.config.events import *

class EntityClickEvent(Event):
    
    def __init__(self, entity):
        self.type = ENTITY_CLICK
        self.entity = entity
        
class EntityCollisionEvent(Event):
    
    def __init__(self, entity1, entity2):
        self.type = ENTITY_COLLISION
        self.entity1 = entity1
        self.entity2 = entity2
        
class EntityLivingDeathEvent(Event):
    
    def __init__(self, entity):
        self.type = ENTITYLIVING_DEATH
        self.entity = entity
        

class EntityLivingDamageEvent(Event):
    """
        source: 0=block, 1=entity
        name: blockname, entityname, etc.
        damage: amount of damage done to the entity
    """    
    def __init__(self, entity, source, name, damage):
        self.type = ENTITYLIVING_DAMAGE
        self.entity = entity
        self.source = source
        self.name = name
        self.damage = damage

class EntityFXSpawnEvent(Event):
    
    def __init__(self, entity):
        self.type = ENTITYFX_SPAWN
        self.entity = entity      

class EntitySpawnEvent(Event):
    
    def __init__(self, entity):
        self.type = ENTITY_SPAWN
        self.entity = entity
        
class EntityDespawnEvent(Event):
    
    def __init__(self, entity):
        self.type = ENTITY_DESPAWN
        self.entity = entity